<?php
$params = require (__DIR__ . '/params.php'); 
return [
    'id' => 'app-api',
    'basePath' => dirname(__DIR__),
    'bootstrap' => [
        'log'
    ],
    'modules' => [
        'v1' => [
        	'class' => 'app\modules\v1\Module'
        ]
    ],
    'controllerNamespace' => 'api\controllers',
    'components' => [
  	    'db' => [
		    'class' => 'yii\db\Connection',
		    'dsn' => 'mysql:host=211.149.198.73;dbname=i78dk',
		    'username' => 'dk',
		    'password' => 'test_l@i78dk.com',
		    'charset' => 'utf8',
	    ], 

	    
    	'log' => [
    		'traceLevel' => YII_DEBUG? 3 : 0,
    		'targets' => [
    			[
    				'class' =>'yii\log\FileTarget',
    				'levels' => ['error', 'warning'],
    			],
			    [
			    'class' => 'yii\log\FileTarget',
			    'levels' => ['info'],
			    'categories' => ['merchantorderqueryhour'],
			    'logFile' => '@app/runtime/logs/Mylog/merchantorderqueryhour.log',
			    ],
			    [
			    'class' => 'yii\log\FileTarget',
			    'levels' => ['info'],
			    'categories' => ['merchantorderquery'],
			    'logFile' => '@app/runtime/logs/Mylog/merchantorderquery.log',
			    ],
			    [
			    'class' => 'yii\log\FileTarget',
			    'levels' => ['info'],
			    'categories' => ['threeElementsQueryLog'],
			    'logFile' => '@app/runtime/logs/Mylog/threeElementsQueryLog.log',
			    ],
			    [
			    'class' => 'yii\log\FileTarget',
			    'levels' => ['info'],
			    'categories' => ['test'],
			    'logFile' => '@app/runtime/logs/Mylog/test.log',
			    ],
    		],
    	],
         'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => false,
            'enableSession' => false,
            'loginUrl' => null
        ], 
        'urlManager' => [
            'enablePrettyUrl' => true, 
            'enableStrictParsing' => true,
            'showScriptName' => false, 
            'rules' => [
                [
                    'class' => 'yii\rest\UrlRule',
                    'controller' => [
			            'v1/cashdesk',  			//收银台
			            'v1/postidentity',  		//商户认证，开通收款
			            'v1/getpicture', 			//商户认证额外材料，图片获取
			            'v1/getidentity', 			//获取商户认证信息
			            'v1/info', 					//我的信息
			            'v1/receivelist',   		//我的收款记录
			            'v1/infoby',				//我的信息2
			            'v1/xyfpayment',    		//扫码支付
			            'v1/kmmerchantorderquery',	//卡盟进件下单查询
			            'v1/weixincallback',		//auth授权回调处理
			            'v1/weixinupload',			//图片上传
			            'v1/delpicture',			//删除图片
			            'v1/threeelement',			//3要素验证
			            'v1/kmmerchantorderqueryhour', //每隔半小时查询一次失败的订单是否还是失败。如果还是失败返还 免手续费金额
                    ]
                ]
            ]
        ]
        
    ],
    'params' => $params
];